package ru.reinvent.perspectiva.activities;


import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;

import ru.reinvent.perspectiva.fragments.OneLotFragment;
import android.os.Bundle;

public class OneLotActivity extends SherlockFragmentActivity 
	{

	public static final String EXTRA_LOT_ID = "selectedLotId";
	
	@Override
	public void onCreate(Bundle savedInstanceState) 
		{
		super.onCreate(savedInstanceState);
		getSupportActionBar().setHomeButtonEnabled(true);
		getSupportActionBar().setDisplayHomeAsUpEnabled(true);
		
		int lotId = getIntent().getIntExtra(EXTRA_LOT_ID, -1);
		getSupportFragmentManager().beginTransaction().add(android.R.id.content,new OneLotFragment(lotId)).commit();
		}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) 
		{
		if (item.getItemId() == android.R.id.home) finish();
			
		return super.onOptionsItemSelected(item);
    	} 

	}
